/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.testing;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.math.BigInteger;
//import org.naga.bulksender.binding.*;

/**
 *
 * @author Prueba
 */
public class BulkSenderMainTest {
/*    public static void readObjectFromXml() {
        Devices devs = null;

        try {
            javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(Devices.class.getPackage().getName());
            javax.xml.bind.Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();

            InputStream in = new FileInputStream("Device-Config.xml");
            if(in == null) {
                    System.out.println("File No Found");
                    return;
            }
            
            devs = (Devices)unmarshaller.unmarshal(in); //NOI18N
            System.out.println("Value" + devs.getDevice().size());
            } catch (Exception ex) {
            // XXXTODO Handle exception
            java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex); //NOI18N
            }

    }
    public static void persistXml() {
        Devices devs = new Devices();
        Device device = new Device();

        device.setModemId("modem1");
        device.setComPort("com3");
        device.setBaudRate( BigInteger.valueOf(100));
        device.setManufacturer("Nokia");
        device.setModel("3220");

        devs.getDevice().add(device);

        device = new Device();

        device.setModemId("modem5");
        device.setComPort("com5");
        device.setBaudRate( BigInteger.valueOf(500));
        device.setManufacturer("Motorola");
        device.setModel("6101");

        devs.getDevice().add(device);

        try {
            javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(devs.getClass().getPackage().getName());
            javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
            marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N
            marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
            //marshaller.marshal(devs, System.out);
            FileOutputStream salida = new FileOutputStream("Device-Config.xml");
            marshaller.marshal(devs, salida);
        } catch (Exception ex) {
            // XXXTODO Handle exception
            java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex); //NOI18N
        }
    }
    
    public static void main(String []args){
        persistXml();
    }*/
}
